
package com.bstek.urule.runtime.rete;

import java.util.List;
import java.util.Map;

/**
 * @author Jacky.gao
 * @since 2015年1月8日
 */
public class OrActivity extends JoinActivity {
    private boolean pass;

    public List<FactTracker> enter(EvaluationContext context, Object obj, FactTracker tracker, Map<String, Object> variableMap) {
        if (pass && variableMap.size() == 0) {
            return null;
        }
        context.setPrevActivity(this);
        pass = true;
        return visitPahs(context, obj, tracker, variableMap);
    }

    @Override
    public boolean orNodeIsPassed() {
        return pass;
    }

    @Override
    public void reset() {
        pass = false;
    }
}
